/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package bean;

import controller.DeleteTimeTable;
import controller.ListTimeTables;
import entities.TimeTable;
import java.util.List;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

/**
 *
 * @author QUY-THI
 */
@ManagedBean
@SessionScoped
public class ListTimeTableBean {

    private List<TimeTable> times;
    private TimeTable time;

    public List<TimeTable> getTimes() {
        ListTimeTables l = new ListTimeTables();
        return l.getTimeTables();
    }

    public void setTimes(List<TimeTable> times) {
        this.times = times;
    }

    public TimeTable getTime() {
        return time;
    }

    public void setTime(TimeTable time) {
        this.time = time;
    }

    /**
     * Creates a new instance of ListTimeTableBean
     */
    public ListTimeTableBean() {
    }

    public String delete() {
        DeleteTimeTable dt = new DeleteTimeTable();
        dt.deleteTimeTable(time);
        return "timeTableInfo.xhtml?faces-redirect=true";
    }
}
